/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package xml;

import no.met.metdata.proxy.MetServiceProxy;
import no.met.metdata.proxy.no_met_metdata_Location;
import no.met.metdata.proxy.no_met_metdata_Metdata;
import no.met.metdata.proxy.no_met_metdata_StationProperties;
import no.met.metdata.proxy.no_met_metdata_TimeStamp;
import no.met.metdata.proxy.no_met_metdata_WeatherElement;

/**
 *
 * @author abnormal
 */
public class EKlima {

    public EKlima() throws Exception {
        MetServiceProxy mt = new MetServiceProxy();
        no_met_metdata_StationProperties[] st = mt.getStationsProperties(null, null);
        for (int i = 0; i < st.length; i++) {
            no_met_metdata_Metdata data = mt.getMetData("0", "", "2004-07-01", "2006-12-31", "18700,50540", "rr,tan,tax", "", "8,9", "");
            no_met_metdata_TimeStamp[] stamp = data.getTimeStamp();
            for (int j = 0; j < stamp.length; j++) {
                System.out.print("from: " + stamp[j].getFrom());
                System.out.println("\tto: " + stamp[j].getTo());
                no_met_metdata_Location[] location = stamp[i].getLocation();
                for (int k = 0; k < location.length; k++) {
                    no_met_metdata_WeatherElement[] weatherElement = location[k].getWeatherElement();
                    System.out.println("location:" + location[k].getType());
                    for (int l = 0; l < weatherElement.length; l++) {
                        System.out.println("\t\tweather: " + weatherElement[l].getValue());

                    }
                }
            }
        }
    }

    public static void main(String[] args) throws Exception {
        EKlima e = new EKlima();

    }
}
